/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.bus.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.bus.entity.VaccineManage;
import com.thinkgem.jeesite.modules.bus.dao.VaccineManageDao;

/**
 * 疫苗维护表Service
 * @author sy
 * @version 2019-06-14
 */
@Service
@Transactional(readOnly = true)
public class VaccineManageService extends CrudService<VaccineManageDao, VaccineManage> {

	public VaccineManage get(String id) {
		return super.get(id);
	}
	
	public List<VaccineManage> findList(VaccineManage vaccineManage) {
		return super.findList(vaccineManage);
	}
	
	public Page<VaccineManage> findPage(Page<VaccineManage> page, VaccineManage vaccineManage) {
		return super.findPage(page, vaccineManage);
	}
	
	@Transactional(readOnly = false)
	public void save(VaccineManage vaccineManage) {
		super.save(vaccineManage);
	}
	
	@Transactional(readOnly = false)
	public void delete(VaccineManage vaccineManage) {
		super.delete(vaccineManage);
	}

	/**
	 * 
	 * @Title: findVaccineTypeListByAnimalTypeCode
	 * @author: sy
	 * @date: 2019年06月14日 16:05
	 * @Description: 根据动物种类查询疫苗种类
	 * @param vaccineManage
	 * @return: java.util.List<java.util.Map<java.lang.String,java.lang.String>>
	 */
    public List<Map<String,String>> findVaccineTypeListByAnimalTypeCode(VaccineManage vaccineManage) {
		List<Map<String,String>> list = dao.findVaccineTypeListByAnimalTypeCode(vaccineManage);
		if(list.size()>0){
			return list;
		}
		return new ArrayList<>();
    }

    /**
     *
     * @Title: findListByVaccineTypeCode
     * @author: sy
     * @date: 2019年06月14日 16:51
     * @Description: 根据疫苗种类查询疫苗
     * @param vaccineManage
     * @return: java.util.List<java.util.Map<java.lang.String,java.lang.String>>
     */
	public List<Map<String,String>> findListByVaccineTypeCode(VaccineManage vaccineManage) {
		List<Map<String,String>> list = dao.findListByVaccineTypeCode(vaccineManage);
		if(list.size()>0){
			return list;
		}
		return new ArrayList<>();
	}
	/**
	 *
	 * @Title: validateName
	 * @author: mengying
	 * @date: 2019年06月17日 11:50
	 * @Description: 添加疫苗验证
	 * @param name
	 * @return: Integer
	 */
	public Integer validateName(String name){
		return dao.validateName(name);
	}
	/**
	 *
	 * @Title: validateEditName
	 * @author: mengying
	 * @date: 2019年06月17日 13:50
	 * @Description: 添加疫苗验证
	 * @param id
	 * @return: String
	 */
	public String validateEditName(String id){
		return dao.validateEditName(id);
	}

	/**
	 * @Author zhangxingliang
	 * @Description  获取所有疫苗
	 * @Date 16:38 2019/6/15
	 **/
	public List<Map<String,Object>> findVaccineManageList( String entId) {
		return this.dao.findVaccineManageList(entId);
	}

	/*
	 * @MethodName: findVaccineList
	 * @Description: 疫苗维护列表
	 * @Param: [vaccineManage,page]
	 * @Return: java.util.List<com.thinkgem.jeesite.modules.bus.entity.VaccineManage>
	 * @Author: my
	 * @Date: 2019/7/23
	 **/
	public Page<VaccineManage> findVaccineList(Page<VaccineManage> page, VaccineManage vaccineManage) {
		vaccineManage.setPage(page);
		page.setList(dao.findVaccineList(vaccineManage));
		return page;
	}
}